<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>系统设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <style>
        .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
    #user_logo_img{
        width: 200px;
        height: 200px;
        border-radius: 360px;
        position: relative;
        right: 50px;
    }
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form layuimini-form" lay-filter="example">
<!--            <div class="layui-form-item layui-upload">-->
<!--                <div class="layui-input-block">-->
<!--                    <img class="layui-upload-img" id="user_logo_img" src="../file/user_logo.png">-->
<!--                    <p>首页LOGO</p>-->
<!--                </div>-->
<!--                <label class="layui-form-label"></label>-->
<!--                <button type="button" class="layui-btn" id="user_logo">上传图片</button>-->
<!--            </div>-->
            <div class="layui-form-item">
                <label class="layui-form-label required">网站名称</label>
                <div class="layui-input-block">
                    <input type="text" name="config_name" lay-verify="required" lay-reqtext="网站域名不能为空" placeholder="请输入网站名称" class="layui-input">
                    <tip>填写自己部署网站的名称。</tip>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label required">首页标题</label>
                <div class="layui-input-block">
                    <textarea name="config_title" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">META关键词</label>
                <div class="layui-input-block">
                    <textarea name="config_keywords" class="layui-textarea" placeholder="多个关键词用英文状态 , 号分割"></textarea>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">META描述</label>
                <div class="layui-input-block">
                    <textarea name="config_descript" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="config_setting">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form','upload'], function () {
        var $ = layui.jquery
            ,form = layui.form
            ,upload = layui.upload
            , layer = layui.layer;
        // $.getJSON("../selectwebconfig",function (data) {
        //     //表单初始赋值
        //     form.val('example', {
        //         "config_name": data.name
        //         , "config_title": data.title
        //         , "config_keywords": data.metakeywords
        //         , "config_descript": data.metadescription
        //     })
        // })
        // //监听提交
        // form.on('submit(config_setting)', function (datas) {
        //     var data = datas.field;
        //     $.post("../updatewebconfig","name="+data.config_name+"&title="+data.config_title+"&MetaKeywords="+data.config_keywords+"&MetaDescription="+data.config_descript,function (dat) {
        //         if(dat==1){
        //             layer.msg("网站配置修改成功！")
        //         }
        //         if(dat==-100){
        //             layer.msg("网站名称修改失败！")
        //         }
        //         if(dat==-200){
        //             layer.msg("首页标题修改失败！")
        //         }
        //         if(dat==-300){
        //             layer.msg("META关键词修改失败！")
        //         }
        //         if(dat==-400){
        //             layer.msg("META描述修改失败！")
        //         }
        //     })
        //     return false;
        // });
        //普通图片上传
        // var uploadInst = upload.render({
        //     elem: '#user_logo'
        //     , url: '../updateuserlogo' //改成您自己的上传接口
        //     ,accept: 'images'
        //     , before: function (obj) {
        //         //预读本地文件示例，不支持ie8
        //         obj.preview(function (index, file, result) {
        //             $('#user_logo_img').attr('src', result); //图片链接（base64）
        //         });
        //     }
        //     , done: function (res) {
        //         //如果上传失败
        //         if (res.code > 0) {
        //             return layer.msg('上传失败');
        //         }
        //         //上传成功
        //     }
        // })
    });
</script>
</body>
</html>